package com.gxa.p2p.service.impl;

import com.gxa.p2p.mapper.RechargerecordMapper;
import com.gxa.p2p.pojo.Outrecord;
import com.gxa.p2p.pojo.Rechargerecord;
import com.gxa.p2p.service.RechargerecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;
import java.util.Map;
@Service("rechargerecordService")
public class RechargerecordServiceImpl implements RechargerecordService {
    @Autowired
    private RechargerecordMapper rechargerecordMapper=null;
    @Override
    public List<Rechargerecord> findRechargelogByPage(Long id, String investPhone, String rechargeType, Boolean state, Timestamp from, Timestamp to, Integer page, Integer size) {
        List<Rechargerecord> maps= rechargerecordMapper.findRechargelogByPage(id, investPhone, rechargeType, state, from, to, (page-1)*size, size);
        return maps;
    }

    @Override
    public List<Outrecord> findWithdrawlogByPage(Long id, String userPhone,  String userName, String bankId, String bankName, String state, Timestamp from, Timestamp to, Integer page, Integer size) {
        List<Outrecord> mapList = rechargerecordMapper.findWithdrawlogByPage(id, userPhone, userName, bankId, bankName, state, from, to, (page-1)*size, size);
        return mapList;
    }

    @Override
    public List<Rechargerecord> selectAll() {
        List<Rechargerecord> maps = rechargerecordMapper.selectAll();

        return maps;
    }

    @Override
    public List<Outrecord> selectByWork1(Long id, String userPhone, String userName, String bankId, String bankName, String state, Timestamp from, Timestamp to) {
        return  rechargerecordMapper.selectByWork1(id, userPhone, userName, bankId, bankName, state, from, to);
    }

    @Override
    public List<Rechargerecord> selectByWork(Long id, String investPhone, String rechargeType, Boolean state, Timestamp from, Timestamp to) {
        return rechargerecordMapper.selectByWork(id, investPhone, rechargeType, state, from, to);
    }
}
